//
//  SubmitToServer.m
//  singlebreath
//
//  Created by Eric van Riet Paap on 29-09-08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "SubmitToServer.h"


@implementation TrainingResult

+(BOOL)Upload:(NSString*)data2submit {
    // create the request
    NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.vanrietpaap.nl/freediving/submit.php"] //XXX +data2submit
        cachePolicy:NSURLRequestUseProtocolCachePolicy
        timeoutInterval:60.0];
        
    // create the connection with the request
    // and start loading the data
    NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
    if (theConnection) {
        // Create the NSMutableData that will hold
        // the received data
        // receivedData is declared as a method instance elsewhere
        receivedData=[[NSMutableData data] retain];
        return YES;
    } else {
        return NO; // inform the user that the download could not be made
    }
}

@end
